package com.stm.bi.api;

import com.stm.framework.annotation.RestApi;
import com.stm.framework.annotation.Module;
import org.springframework.web.bind.annotation.*;
import com.stm.framework.annotation.ReqParam;
import com.stm.framework.dto.Response;
import com.stm.bi.dto.query.SubjectCategoryListQry;
import com.stm.bi.dto.query.SubjectCategoryTreeQry;
import com.stm.bi.service.SubjectCategoryService;
import jakarta.annotation.Resource;
import com.stm.bi.dto.vo.SubjectCategoryVO;
import com.stm.bi.dto.vo.SubjectCategoryTreeVO;
import java.util.List;

/**
 * 科目分类RPC服务
 * @author qinyongjie
 * @date 2025-05-22
 */

@RestController
@Module("科目分类.RPC接口")
public class SubjectCategoryRemoteServiceImpl implements SubjectCategoryRemoteService{
    @Resource
    private SubjectCategoryService subjectCategoryService;

    /**
    * 科目分类详细查询
    */
    @RestApi(name = "科目分类详细查询", author = "qinyongjie", idx=1)
    @GetMapping(value = "/rpc/subjectCategory/{id}")
    public Response<SubjectCategoryVO> selectById(@PathVariable("id")@ReqParam(label = "id",required = true) Long id){
        return subjectCategoryService.selectById(id);
    }

    /**
     * 科目分类树查询
     */
    @RestApi(name = "科目分类树查询", author = "qinyongjie", idx=2)
    @GetMapping(value = "/rpc/subjectCategory/tree")
    public Response<List<SubjectCategoryTreeVO>> selectTree(SubjectCategoryTreeQry qry){
        return subjectCategoryService.selectTree(qry);
    }

}
